﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Pigg.Model;

namespace Pigg.Data.Configurations
{
    public class AuthPermissionConfiguration : EntityTypeConfiguration<AuthPermission>
    {
        public AuthPermissionConfiguration()
        {
            HasKey(k => k.Id);
            Property(p => p.Id)
                .HasColumnName("Id")
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();

            Property(p => p.Name)
                .HasMaxLength(255)
                .IsRequired();
        }
    }
}
